package uestc.lj.gulishop.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import uestc.lj.common.utils.PageUtils;
import uestc.lj.gulishop.product.entity.AttrEntity;
import uestc.lj.gulishop.product.vo.AttrGroupRelationVO;
import uestc.lj.gulishop.product.vo.AttrResponseVO;
import uestc.lj.gulishop.product.vo.AttrVO;

import java.util.List;
import java.util.Map;

/**
 * 商品属性
 *
 * @author crazlee
 * @email peterlee0@163.com
 * @date 2021-05-21 16:56:25
 */
public interface AttrService extends IService<AttrEntity> {

    PageUtils queryPage(Map<String, Object> params);

    void saveAttr(AttrVO attr);

    PageUtils queryBaseAttrPage(Map<String, Object> params, Long catelogId, String type);

    AttrResponseVO getAttrInfo(Long attrId);

    void updateAttr(AttrVO attr);

    /**
     * 根据分组ID获取组内所有关联的属性
     * @param attrgroupId
     * @return
     */
    List<AttrEntity> getRelationAttr(Long attrgroupId);

    /**
     * 删除属性与分组的关联关系
     * @param attrGroupRelationVOS
     */
    void deleteRelation(AttrGroupRelationVO[] attrGroupRelationVOS);

    /**
     * 获取当前分组没有关联的属性
     * @param params
     * @param attrgroupId
     * @return
     */
    PageUtils getNoRelationAttr(Map<String, Object> params, Long attrgroupId);

    List<Long> selectSearchAttrIds(List<Long> attrIds);
}

